using System;
using System.Collections.Generic;
using FluentDBC.ContractAction;

namespace FluentDBC.Default
{
    public class ContractActionDefaultSetting
    {
        private readonly IDictionary<string, Type> _contractActions;

        public ContractActionDefaultSetting(IDictionary<string, Type> contractActions)
        {
            _contractActions = contractActions;

            AddDefaultSetting();
        }

        public IDictionary<string, Type> GetDefaultSettings()
        {
            return _contractActions;
        }

        private void AddDefaultSetting()
        {
            if (_contractActions == null)
                throw new NullReferenceException(GlobalFluentDBCResources.ContractActionDictionaryIsNull);

            _contractActions.Add("IsNotNull", typeof(IsNotNullAction));
            _contractActions.Add("IsNotNullOrEmpty", typeof(IsNotNullOrEmptyAction));
        }
    }
}